<?php require('globals.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<!--
		Probably a good gesture for this page and the associated
		display page would be to generate a simple function that
		takes and element from some array and builds them here.
		It would be faster, cleaner, and would take much better
		advantage of things PHP would do for me.

		It's probably worth the effort to use foreach() array
		banging to generate the longer option lists in a much
		smoother order.  It'd eliminate de-synchroniziations
		pretty easily.

		This form hasn't been updated since 2011 (maybe 2010), as
		dealers are rarely inserted manually but are imported
		automatically from the ultracart system.  Use is not
		recommended; if you must manually add a dealer, it's
		probably going to have to be done by hand via the
		Workbench, as the fields here are out of order and
		inaccurate, and the submission scripts are extremely old.
-->

<html>
<head>

  <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
  <title>Add Dealer</title>

<script>window.alert("This page was outmoded by updates in 2012.  Using it is not recommended, and its behaviour may be unpredictable at #best#.")</script>
<SCRIPT type="text/javascript" src="dealers.php"></SCRIPT>

</head>
<body onload="SetItOff()">

<table border=0 rules=none>
<form method="POST" action="http://<?=$LOCAL_IP ?>/Submit Dealer.php" name="submit">

<tr><td>Postmark: </td><td><input size="12" maxlength="12" name="postmark"></td>
<td>Date Entered: </td><td><input size="12" maxlength="12" name="date_entered" readonly value=<?=date('m/d/y') ?>></td></tr>
<!-- these are disabled as payment/registration cannot happen BEFORE data entry
     this is a temporary thing, and should be fixed via code alterations -->
<tr><td>Billed?</td><td><input disabled type="checkbox" value="0" name="has_been_billed"></td>
    <td>Billing Date:</td><td><input readonly size="12" maxlength="12" value="" name="date_billed"></td></tr>
<tr><td>Registered?</td><td><input disabled type="checkbox" value="0" name="has_been_registered"></td>
    <td>Registration Date:</td><td><input readonly size="12" maxlength="12" value="" name="date_registered"></td></tr>

<tr><td>Dealership Name:</td><td colspan="3"><input size="60" maxlength="60" name="dealership_name"></td></tr>

<input name="dealer_asst" value="0" type="hidden"></td></tr>

<tr><td>Table Size (Requested):</td><td colspan="3">
  <select size="1" name="table_size_req">
  <option value=0>Half</option>
  <option value="1">Full</option>
  <option value="2">Double</option>
  <option value="3">Triple</option>
  <option value="4">Island</option>
  </select></td></tr>

<tr><td>Table Size (Minimum):
</td><td colspan="3"><select size="1" name="table_size_min">
  <option value="5">Requested Required</option>
  <option value="0">Half</option>
  <option value="1">Full</option>
  <option value="2">Double</option>
  </select></td></tr>

<tr><td>Table Size (Assigned):
</td><td colspan="3"><select size="1" name="table_size_act" onchange="populateMenus(this.form.assignment, this.selectedIndex-1, ((this.selectedIndex == -1) ? null : table_array[this.selectedIndex-1]));">
  <option selected value=-1>Select A Size</option>
  <option value=0>Half</option>
  <option value=1>Full</option>
  <option value=2>Double</option>
  <option value=3>Triple</option>
  <option value=4>Island</option>
</select></td></tr>

<tr><td>Table Assignment:</td>
<td colspan="3"><select size="1" name="assignment">
</select></td></tr>

<tr><td>Special Requests:</td>

<td colspan="3"><input name="requests" onclick="calculateTotal()" value="table_pref" type="radio">Specific Table Assignment</td></tr>
<tr><td></td><td colspan="3"><input name="requests" onclick="calculateTotal()" value="wall" type="radio">Wall Space</td></tr>
<tr><td></td><td colspan="3"><input name="requests" onclick="calculateTotal()" value="table_adjacent_to" type="radio">Adjacent To Specific Dealer(s)</td></tr>
<tr><td></td><td colspan="3"><input name="requests" onclick="calculateTotal()" value="table_away_from" type="radio">Away From Specific Dealer(s)</td></tr>
<tr><td></td><td colspan="3"><input checked="checked" name="requests" onclick="calculateTotal()" value="table_no_request" type="radio">No Special Requests</td></tr>
<tr><td></td><td colspan="3"><input name="power" onclick="calculateTotal()" value="1" type="checkbox">Active Power</td></tr>

<tr><td>First Name:</td><td colspan="3"><input maxlength="30" size="30" name="dealer_first_name"></td></tr>
<tr><td>Initial:</td><td colspan="3"><input maxlength="5" size="5" name="dealer_initial"></td></tr>
<tr><td>Last Name:</td><td colspan="3"><input size="30" maxlength="30" name="dealer_last_name"></td></tr>
<tr><td>Street Address:</td><td colspan="3"><input maxlength="45" size="45" name="dealer_address"></td></tr>
<tr><td>City:</td><td colspan="3"><input maxlength="20" size="20" name="dealer_city"></td></tr>
<tr><td>State/Province/Other:</td><td colspan="3"><input maxlength="12" size="12" name="dealer_state"></td></tr>
<tr><td>Postal Code:</td><td colspan="3"><input maxlength="10" size="10" name="dealer_post_code"></td></tr>
<tr><td>Country:</td><td colspan="3"><input maxlength="10" size="10" name="dealer_country"></td></tr>
<tr><td>Email Address:</td><td colspan="3"><input maxlength="35" size="35" name="dealer_email"></td></tr>
<tr><td>Phone Number:</td><td colspan="3"><input maxlength="18" size="18" name="dealer_phone"></td></tr>
<tr><td>Badge Name:</td><td colspan="3"><input maxlength="25" size="25" name="dealer_badgename"></td></tr>

<tr><td>Date of Birth:</td><td>
  <select size="1" onchange="minorCheck()" name="dealer_dob_month">
  <option value="0">January</option>
  <option value="1">February</option>
  <option value="2">March</option>
  <option value="3">April</option>
  <option value="4">May</option>
  <option value="5">June</option>
  <option value="6">July</option>
  <option value="7">August</option>
  <option value="8">September</option>
  <option value="9">October</option>
  <option value="10">November</option>
  <option value="11">December</option>
  </select>

<select size="1" onchange="minorCheck()" name="dealer_dob_day">
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
  <option value="5">5</option>
  <option value="6">6</option>
  <option value="7">7</option>
  <option value="8">8</option>
  <option value="9">9</option>
  <option value="10">10</option>
  <option value="11">11</option>
  <option value="12">12</option>
  <option value="13">13</option>
  <option value="14">14</option>
  <option value="15">15</option>
  <option value="16">16</option>
  <option value="17">17</option>
  <option value="18">18</option>
  <option value="19">19</option>
  <option value="20">20</option>
  <option value="21">21</option>
  <option value="22">22</option>
  <option value="23">23</option>
  <option value="24">24</option>
  <option value="25">25</option>
  <option value="26">26</option>
  <option value="27">27</option>
  <option value="28">28</option>
  <option value="29">29</option>
  <option value="30">30</option>
  <option value="31">31</option>
  </select>

<input maxlength="4" size="4" value="1990" onblur="minorCheck()" name="dealer_dob_year"></td>
<td>Is Dealer Minor?</td><td><input disabled="disabled" value=1 name="dealer_isminor" type="checkbox"></td></tr>

<tr><td>Tax Identification Number:</td><td colspan="3"><input maxlength="10" size="10" name="tax_id"></td></tr>

<tr><td>Number of Dealer's Assistants:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
<td colspan="3"><select size="1" onchange="seatsCheck()" name="dealer_assist_no">
  <option selected value="0">None</option>
  <option value="1">One</option>
  <option value="2">Two</option>
  <option value="3">Three</option>
  <option value="4">Four</option>
  <option value="5">Five</option>
  <option value="6">Six (Island ONLY)</option>
  <option value="7">Seven (Island ONLY)</option>
  </select></td></tr>

<tr><td>Payment Method:</td>
  <td colspan="3"><select size="1" name="payment_method">
  <option selected="selected" value="0">No Payment</option>
  <option value="1">Credit Card</option>
  <option value="2">Check</option>
  <option value="3">Money Order</option>
  <option value="4">Cash</option>
  </select></tr>

  </td>

<tr><td>Total Charge:</td><td><input size="6" readonly name="payment_amount" value="0"></td>
<td>Payment Provided:</td><td><input size="6" name="payment_provided" value="0"></td></tr>

<tr><td>Dealer Notified?</td><td><input name="is_notified" value="1" type="checkbox"></td>
<td>Notification Date:</td><td><input name="notification_date" size="12"></td></tr>

<tr><td>Dealer Cancelled?</td><td><input name="cancelled" value="1" type="checkbox"></td>
<td>Cancellation Date:</td><td><input name="cancelled_date" size="12"></td></tr>

<tr><td>Issue With Application?</td><td colspan="3"><input name="trouble" value="1" type="checkbox"></td></tr>

<tr><td>Notes:</td><td colspan=3>
<textarea cols="65" rows="4" name="table_note"></textarea></td></tr>

<tr><td colspan=4><center><input type="submit" value="Submit Dealer">
  <input type="reset" value="Reset Form"></td></tr>
</center></table>
</form>
</body>
</html>